gdk-pixbuf-animation.c (gdk_pixbuf_animation_new_from_file) Avoid
authorMatthias Clasen <mclasen@redhat.com>
Mon, 27 Dec 2004 22:50:45 +0000 (22:50 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Mon, 27 Dec 2004 22:50:45 +0000 (22:50 +0000)
2004-12-27  Matthias Clasen  <mclasen@redhat.com>

* gdk-pixbuf-animation.c (gdk_pixbuf_animation_new_from_file)
Avoid deadlock. Pointed out by Callum McKenzie.

gdk-pixbuf/ChangeLog
gdk-pixbuf/gdk-pixbuf-animation.c

index 0111c220073820a924238a8212895312915e0884..2b453a37bc3463cbf51d4446cd750fd2890891ec 100644 (file)
@@ -1,3 +1,8 @@
+2004-12-27  Matthias Clasen  <mclasen@redhat.com>
+
+       * gdk-pixbuf-animation.c (gdk_pixbuf_animation_new_from_file) 
+       Avoid deadlock. Pointed out by Callum McKenzie.
+       
 Wed Dec 22 01:17:44 2004  Jonathan Blandford  <jrb@redhat.com>
 
        * queryloaders.c (main): print out the version and binary name in
index 22bf2456023be78fd01c03e51ff1ce6ea1cce0b6..2e84d333ac7ea48afac806e9f6f52166c4bc87d1 100644 (file)
@@ -139,7 +139,7 @@ gdk_pixbuf_animation_new_from_file (const char *filename,
        guchar buffer [128];
        GdkPixbufModule *image_module;
         gchar *display_name;
-        gboolean locked;
+        gboolean locked = FALSE;
 
        g_return_val_if_fail (filename != NULL, NULL);
         g_return_val_if_fail (error == NULL || *error == NULL, NULL);
@@ -184,8 +184,6 @@ gdk_pixbuf_animation_new_from_file (const char *filename,
                         return NULL;
                 }
 
-        locked = _gdk_pixbuf_lock (image_module);
-
        if (image_module->load_animation == NULL) {
                GdkPixbuf *pixbuf;
 
@@ -221,6 +219,8 @@ gdk_pixbuf_animation_new_from_file (const char *filename,
 
                 g_object_unref (pixbuf);
        } else {
+                locked = _gdk_pixbuf_lock (image_module);
+
                fseek (f, 0, SEEK_SET);
                animation = (* image_module->load_animation) (f, error);